<template>
  <MFormDialog
    v-model="formDialog.visible"
    v-bind="formDialog"
    :fields="dialogFields"
    :httpEdit="resetPassWord"
    @reload="reload"
    editTitle="重置密码"
    style="width: 500px"
  ></MFormDialog>
</template>
<script setup lang="ts">
import { dialogFields } from '@/views/layout/components/userMenu/config.ts'
import { resetPassWord } from '@/api/system/user/user.ts'
import { reactive } from 'vue'

const emit = defineEmits(['reload'])

// 新增/编辑
const formDialog = reactive({
  visible: false,
  id: 0
})

const show = (id: number) => {
  formDialog.id = id
  formDialog.visible = true
}

const reload = () => {
  emit('reload')
}

defineExpose({ show })
</script>
<style scoped lang="scss"></style>
